// write your code here cpp
#include<iostream>
using namespace std;
int main(){
    long long n;
    //每次分三堆 举例子找规律
    while(cin>>n){
        if(n==0) return 0;
        long long count =0;
        while(n>1){
            count++;
            n=n/3+ (n%3>0);
        }
        cout<<count<<endl;
    }
}